﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MyExcel = Microsoft.Office.Interop.Excel;

namespace DataAccessObject.Excel
{
    class HocSinhExcel
    {
        public static List<HOCSINH> ReadHocSinhFromFile(string pathName)
        {
            List<HOCSINH> listHocSinh = new List<HOCSINH>();
            var excelApp = new MyExcel.Application();

            MyExcel._Workbook workbook = excelApp.Workbooks.Open(pathName);
            MyExcel._Worksheet worksheet = workbook.Sheets[1];

            //get used range
            MyExcel.Range range = worksheet.UsedRange;
            int rowCount = range.Rows.Count;
            int colCount = range.Columns.Count;


            return listHocSinh;
        }
    }
}
